<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>

<body>
    <!-- vue中不仅可以绑定文本和事件，也可以绑定标签的其他属性
        语法：v-bind：属性名=属性值
        简写：      ：属性名=属性值
     -->
    <div id="app">
        <input type="text" @keyup.enter="a" v-model="imgSrc">
        <br />
        <img style="width: 300px;" :src="imgSrc" :title="heroName">
    </div>

    <script>
        let vm = new Vue({
            el: app,
            data: {
                imgSrc: 'http://i1.073img.com/170322/17598513_142940_1_lit.jpg',
                heroName: '安琪拉'
            },
            methods: {
                a() {
                    console.log(this.imgSrc)
                }
            }
        })
    </script>
</body>

</html>